package 结构型模型.享元模式;

/**
 * 享元类
 */
public interface AbstractXY {
    String getColor();
    void display(WZ wz);
}

/**
 * 具体享元类
 */
class XY implements AbstractXY{

    private String color;

    public XY(String color) {
        this.color = color;
    }

    @Override
    public String getColor() {
        return color;
    }

    @Override
    public void display(WZ wz) {
        System.out.println("棋子颜色:"+color);
        System.out.println("显示棋子:  "+wz.getX()+"..."+wz.getY());
    }


}

